/*LICENSE_BEGIN
 * ******************************************************************
 * Copyright 2006 by the Dainamite Robocup-Team at the
 * DAI-Labor, TU-Berlin (www.dai-labor.de)
 * 
 * Members of Dainamite are:
 * Holger Endert
 * Robert Wetzker
 * Thomas Karbe
 * Axel Heßler
 * Philippe Bütter
 * Felix Brossmann
 * 
 * Licensed under the GNU GPL (General Public License) Free Software 
 * License, Version 2. You may use this file only in compliance with 
 * the License. You may obtain a copy of the License at:
 * 
 * http://www.fsf.org/licensing/licenses/gpl.txt
 * ******************************************************************
LICENSE_END*/
package robocup.component.actions;

/**
 * A catch action can only be executed by the goalie. This will try to catch 
 * the ball. Note that backpasses are not allowed.
 */

public class CatchAction extends Action {
	
	/**
	 * The direction, in which the catch-command should be executed.
	 */
	private double _direction;

	/**
	 * Constructor with catch-direction
	 * 
	 * @param direction
	 *            the direction, in which the catch-command should be executed
	 */
	public CatchAction(double direction) {
		this._direction = direction;
		this._type = TYPE.CATCH_BALL;
	}

	/**
	 * Returns the actions string representation:
	 * @return (catch &lt;direction&gt;)
	 */
	@Override
	public String toString() {
		StringBuffer buf = new StringBuffer();
		buf.append("(catch ");
		buf.append(this._direction);
		buf.append(")");
		return buf.toString();
	}

	/**
	 * @return Returns the direction.
	 */
	public double getDirection() {
		return this._direction;
	}
}
